package br.inf.solutions.apresentacoes.ssp.view.composer.basicforms;

import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;

import br.com.vexillum.util.ReflectionUtils;
import br.com.vexillum.util.SpringFactory;
import br.inf.solutions.apresentacoes.ssp.control.basics.TypeScaleServiceController;
import br.inf.solutions.apresentacoes.ssp.model.basics.TypeScaleService;

@SuppressWarnings("serial")
@org.springframework.stereotype.Component
@Scope("prototype")
public class TypeScaleServiceComposer extends BasicFormsComposer<TypeScaleService, TypeScaleServiceController> {

	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);		
		loadBinder();
		doAction("listAll");
	}
	
	@Override
	protected String getUpdatePage() {
		return "/paginas/tipoescalaservico/modalCadastrar.zul";
	}
	
	@Override
	protected String getDeactivationMessage() {
		return "Tem certeza que deseja desativar ?";
	}
	
	@Override
	protected String getActivationMessage() {
		return "Tem certeza que deseja ativar?";
	}

	@Override
	public TypeScaleServiceController getControl() {
		return SpringFactory.getController("typeScaleServiceController", TypeScaleServiceController.class, ReflectionUtils.prepareDataForPersistence(this));
	}

	@Override
	public TypeScaleService getEntityObject() {
		return new TypeScaleService();
	}
}